package com.hippo.core.pojo.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * warn_rule
 * @author 
 */
@Data
@TableName(value = "warn_rule")
@Schema(name = "WarnRule", description = "预警规则")
public class RuleWarn implements Serializable {
    /**
     * 主键ID
     */
    @Schema(name = "id", description = "主键ID")
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    /**
     * 预警编码
     */
    @Schema(name = "warnCode", description = "预警编码")
    @TableField(value = "warn_code")
    private String warnCode;

    /**
     * 触发条件
（1：单条件触发；
2：多条件触发）
     */
    @Schema(name = "triggerCondition", description = "触发条件")
    @TableField(value = "trigger_condition")
    private Short triggerCondition;

    /**
     * 提醒方式
（1：短信提醒 
2：系统消息提醒
3：短信提醒和系统消息提醒）
     */
    @Schema(name = "warnType", description = "提醒方式")
    @TableField(value = "warn_type")
    private Short warnType;

    /**
     * corn表达式
     */
    @Schema(name = "corn", description = "corn表达式")
    @TableField(value = "corn")
    private String corn;

    /**
     * 提醒角色ID （暂定拼接）
     */
    @Schema(name = "roleId", description = "提醒角色ID")
    @TableField(value = "role_id")
    private Integer userId;

    /**
     * 提醒组织ID（暂定逗号拼接）
     */
    @Schema(name = "orgId", description = "提醒组织ID")
    @TableField(value = "org_id")
    private Integer companyId;

    /**
     * 创建时间
     */
    @Schema(name = "createTime", description = "创建时间")
    @TableField(value = "create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 创建人ID
     */
    @Schema(name = "createUserId", description = "创建人ID")
    @TableField(value = "create_user_id")
    private Integer createUserId;

    /**
     * 创建人
     */
    @Schema(name = "createUserName", description = "创建人")
    @TableField(value = "create_user_name")
    private String createUserName;

    /**
     * 更新时间
     */
    @Schema(name = "updateTime", description = "更新时间")
    @TableField(value = "update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /**
     * 状态（0:无效 1：有效）
     */
    @Schema(name = "status", description = "状态")
    @TableField(value = "status",fill = FieldFill.INSERT)
    private Short status;

    private static final long serialVersionUID = 1L;
}